/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package us.oh.k12.wkw.robot.command;

/**
 *
 * @author Team4145
 */
public class DriveTurn90Cmd extends CommandBase {

    public DriveTurn90Cmd(boolean pTurnLeft) {
        super(pTurnLeft ? "DriveTurnLeft90Cmd" : "DriveTurnRight90Cmd");
        this.requires(this.getDriveSystem());
    }

    protected void initialize() {

        // reset gyro to 0 degree heading
        this.getDriveSystem().resetGyro();

    }

    protected void execute() {

        this.getDriveSystem().tankDrive(-1.0, 1.0);

        //System.out.println("Heading=" + this.getDriveSystem().getGyroHeading() + ".");

    }

    protected boolean isFinished() {

        return this.getDriveSystem().getGyroHeading() > 85;

    }
}
